<?php

error_reporting(E_ALL);  // Turn on all errors, warnings and notices for easier debugging

global $answersArray;
//var_dump($_GET);
isset($_GET['arr']) ? $answersArray = $_GET['arr'] : die("Get Request Failed");

//echo "Let's sum up the results<br/>";

global $ascAnswersArray;
$ascAnswersArray['purpose'] = $answersArray[0];//options: simple, pro
$ascAnswersArray['measures'] = $answersArray[1];//options: small, medium, large
$ascAnswersArray['battery'] = $answersArray[2];//options: small, medium, big
$ascAnswersArray['design'] = $answersArray[3];//options: innovative, conservative
$ascAnswersArray['moneyLowerBound'] = $answersArray[4];
$ascAnswersArray['moneyUpperBound'] = $answersArray[5];

echo "<h1 style='text-align:center'>";
echo "--<u>Let's sum up the results</u>--";

echo "<br/><br/><br/><br/><br/>";

echo "<u>Purpose of use</u>: ";
switch ($ascAnswersArray['purpose']) {
	case 'simple':
		echo "Basic use: day to day laptop activity. <br/>For example: document editing, video, surfing the web etc.<br/>";
		break;
	case 'pro':
		echo "High performance: I am challenging my laptop. <br/>For example: a gamer, a designer, an engineer, etc.<br/>";
		break;
}
echo "<u>Measurements:</u> ".$ascAnswersArray['measures'].", ";
switch ($ascAnswersArray['measures']) {
	case 'small':
		echo "devices that weight up to 1.5 kg<br/>";
		break;
	case 'medium':
		echo "devices that weight between 1.5 - 2.5 kg<br/>";
		break;
	case 'large':
		echo "Over 2.5 kg<br/>";
		break;
}
echo "<u>Design:</u> ".$ascAnswersArray['design'].", ";
switch ($ascAnswersArray['design']) {
	case 'innovative':
		echo "I like innovative stuff<br/>";
		break;
	case 'conservative':
		echo "I don’t pay too much attention to the design<br/>";
		break;
}
echo "<u>Battery life:</u> ".$ascAnswersArray['battery'].", ";
switch ($ascAnswersArray['battery']) {
	case 'small':
		echo "up to 2.5 hours autonomy<br/>";
		break;
	case 'medium':
		echo "3-5 hours autonomy<br/>";
		break;
	case 'big':
		echo "5-8 hours autonomy<br/>";
		break;
}

echo "<u>Money range:</u> ".$ascAnswersArray['moneyLowerBound']."\$ to ".$ascAnswersArray['moneyUpperBound']."\$<br/>";
echo "</h1>";
?>
